package com.shycloud.mido.organ.api.feign;

import com.shycloud.mido.member.api.entity.BasicComboGoods;
import com.shycloud.mido.member.api.entity.BasicGoodsInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

import com.shycloud.mido.common.core.util.R;

/**
 * member feign
 *
 * @author nianhua.jiang
 * @date 2020/6/10 14:54
 */
@FeignClient(value = "shycloud-member-biz")
public interface RemoteMemberService {

	/**
	 * 获取用户详情
	 *
	 * @param phone
	 * @return com.baomidou.mybatisplus.extension.api.R
	 * @author nianhua.jiang
	 * @date 2020/6/10 15:00
	 */
	@RequestMapping(method = RequestMethod.GET, value = "/member/getMemberByPhone")
	R getMemberByPhone(@RequestParam("phone") String phone);

	/**
	 * 获取教师ID
	 *
	 * @param orgId
	 * @return java.lang.String
	 * @author nianhua.jiang
	 * @date 2020/7/9 15:24
	 */
	@GetMapping("/teacherStudent/getTeacherId")
	String getTeacherId(@RequestParam("orgId") Integer orgId);

	@PostMapping("/member/addVipMember")
	R addVipMember(@RequestBody Map<String, Object> request);

	@GetMapping("/teacherapproval/addApproval")
	R addApproval(@RequestParam("memberId") String memberId);

	@GetMapping("/shopping/getGoodsByCombo")
	List<BasicComboGoods> getGoodsByComboId(@RequestParam("comboId") Integer comboId);

	@GetMapping("/shopping/matchGoodsByKey")
	List<BasicGoodsInfo> matchGoodsInfoByKeyword(@RequestParam("keyword") String keyword);

	/** 根据ID获取商品信息 */
	@GetMapping("/goods/getGoodsByIdFeign")
	BasicGoodsInfo getGoodsByIdFeign(@RequestParam("id") Integer id);

	/** 新增商品 */
	@GetMapping("/goods/addGoodsInfoFeign")
	BasicGoodsInfo addGoodsInfoFeign(@RequestBody BasicGoodsInfo goodsInfo);

}
